# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-colorful
pkgver=0.5.6
pkgrel=2
pkgdesc="Terminal string styling done right, in Python"
url="https://github.com/timofurrer/colorful"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/timofurrer/colorful/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/colorful-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest tests/
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
265e36c73a7ec183e4fd87d3db718b1bae353a99185eb4b1b5e057a6eda502b65672a3f0f9a569c76e6bf9342a1e2ee47fd2f4a8eaa08585f9806aa75c850661  py3-colorful-0.5.6.tar.gz
"
